//
//  UserManager.m
//  XiangMu
//
//  Created by 康世标 on 15/9/6.
//  Copyright (c) 2015年 康世标. All rights reserved.
//

#import "UserManager.h"
#import "UrlHeader.h"
#import "AFHTTPRequestOperationManager.h"
@implementation UserManager
+ (BOOL)login{
    
    NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults];
    
    NSString * msg = [userDefaults objectForKey:@"msg"];
    
    
    
    if ([msg isEqualToString:@""]||msg==nil)
    {
        
        return YES;
    }
    
    
    return NO;
    
    
}
+ (void)GuoQiLeMa {
    
    AFHTTPRequestOperationManager *manager =[AFHTTPRequestOperationManager manager];
    
    [manager GET:[NSString stringWithFormat:@"%@/user/query/%@",URL,[[NSUserDefaults standardUserDefaults] objectForKey:@"msg"]] parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject)
    {
        
//        NSLog(@" ---%@",responseObject);
        if ([[responseObject valueForKey:@"status"] intValue]==201) {
            

                [[NSUserDefaults standardUserDefaults]removeObjectForKey:@"msg"];


            
        }
        
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
    }];

}
@end
